home *** CD-ROM | disk | FTP | other *** search
- MMapFile.Zip is a study on using Win32 memory mapped files.
- I got interested in this trying to find the best way to share
- information between different applications in a package
- we distribute at work. Essentially, when a user logs into
- our system, a list of things within our application the
- user is permitted to do is created. Wwe didn't want to
- require the user to log into each application he/she may use
- simultaneously. After looking into mapped files, I discovered
- there are many possible uses for it within our applications.
-
- There are several sample programs and one unit named
- E_Memmap.pas. This unit implements memory mapping. It
- can be used to simply map dynamic data within an application
- or map the more permenant disk files. The unit also provides
- for synchronization through mutexes.
-
- There are other comments, rules for using and warnings in
- E_Memmap.pas.
-
- The projects:
-
- Mem1.dpr - My first test project, simply maps an
- integer into memory.
-
- MemX1.dpr - Maps an integer array into memory and
- uses mutexes.
-
- Mem2X.dpr - Maps a large integer array and uses
- mutexes. Maps in half of the total array size
- at a time and allows mapping to either half. That is
- Win32 sets up a map for the whole array but the
- program only gets a view of half it at a time.
-
- MemF1.dpr - Does all of the above but uses a file
- this time and increases the size of the array.
-
- To get a feal for how they work, run two or more instances of the same
- exe at the same time, moving between them changing stuff and looking
- for the change in each running process. To see how the mutexes work
- click to change a value in one app, leave the input window up and
- go into another running instance and do the same thing. The second
- one will lock on the button press until you close the input window
- in the first.
-
- Any comments or suggestions will be greatly appreciated.
-
- David Spies
-
- DSPIES@onecom.com
- davidsp@eastsoft.com
-